package com.xjg.jms;

import org.springframework.jms.core.JmsTemplate;

import com.xjg.domain.MessageInfo;

public class Receiver {
    private JmsTemplate jmsTemplate;
    //getter and setter
    public JmsTemplate getJmsTemplate() {
        return jmsTemplate;
    }
    public void setJmsTemplate(JmsTemplate jmsTemplate) {
        this.jmsTemplate = jmsTemplate;
    }
    
    /**
     * 构造函数
     */
    public Receiver() {
    }

    public MessageInfo receiveMessage() {
       
        MessageInfo message = (MessageInfo) jmsTemplate.receiveAndConvert();
       
        return message;
    }


}
